{#
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/new/desktop/base.html" %}

{# FxA automated tests use this attribute to verify the page #}
{% block html_attrs %}data-test-fxa-template="firefox-download-thanks"{% endblock %}

{# "scene2" page should not be indexed to avoid it appearing in search results: issue 7024 #}
{% block canonical_urls %}<meta name="robots" content="noindex,follow">{% endblock %}

{% block extrahead %}
  {{ super() }}
  {{ css_bundle('protocol-emphasis-box') }}
  {{ css_bundle('firefox_desktop_download_thanks') }}
{% endblock %}

{% block site_header %}
  {% with hide_nav_download_button=True %}
    {% include 'includes/protocol/navigation/navigation.html' %}
  {% endwith %}
{% endblock %}

{% set referrals = '?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=firefox-download-thanks' %}

{% block content %}
<main>
  <div class="mzp-c-notification-bar mzp-t-success show-auto-download-notification">
    {# fallback_url is replaced by the platform download link via JS, but if
        something fails the user should still get a link to a working download path. #}
    <p>
      {{ ftl('firefox-desktop-download-your-firefox-new-should-begin', id='direct-download-link', fallback_url=url('firefox.all'))}}
    </p>
  </div>

  <div class="mzp-l-content">
    <div class="mzp-c-logo mzp-t-logo-lg mzp-t-product-firefox"></div>

    <h1 class="mzp-has-zap-8 c-section-title show-windows">{{ ftl('firefox-desktop-download-almost-there') }}<br>{{ ftl('firefox-desktop-download-now-windows') }}</h1>

    <h1 class="mzp-has-zap-8 c-section-title show-mac">{{ ftl('firefox-desktop-download-almost-there') }}<br>{{ ftl('firefox-desktop-download-now-mac') }}</h1>

    <h1 class="mzp-has-zap-8 c-section-title show-linux">{{ ftl('firefox-desktop-download-almost-there') }}<br>{{ ftl('firefox-desktop-download-select-linux') }}</h1>

    <h1 class="mzp-has-zap-8 c-section-title show-else">{{ ftl('firefox-desktop-download-almost-there') }}<br>{{ ftl('firefox-desktop-download-now-else') }}</h1>

    <h1 class="c-section-title show-unknown">{{ ftl('firefox-desktop-download-interrupted') }}</h1>

  {% if ftl_has_messages('firefox-desktop-download-if-you-see-a-prompt', 'firefox-desktop-download-visit-support-for-more') %}
    <aside class="c-windows-disclaimer mzp-c-emphasis-box show-windows-10-plus">
      <img class="c-windows-disclaimer-logo" src="{{ static('img/logos/windows/logo-windows-black.svg') }}" alt="{{ ftl('firefox-desktop-download-windows') }}" width="132" height="28">
      <p>{{ ftl('firefox-desktop-download-if-you-see-a-prompt', attrs='href="https://support.mozilla.org/kb/windows-10-warns-me-use-microsoft-verified-app%s" rel="external noopener" data-cta-text="Get help with your installation"'|safe|format(referrals)) }}</p>

      <p><a href="https://support.mozilla.org/kb/windows-10-warns-me-use-microsoft-verified-app{{ referrals }}" rel="external noopener" data-cta-text="Visit Support for More Details">{{ ftl('firefox-desktop-download-visit-support-for-more') }}</a></p>
    </aside>
  {% endif %}

    <div class="c-support-install">
      <p class="show-mac">
        {% set support_mac_attrs = 'href="https://support.mozilla.org/kb/how-download-and-install-firefox-mac%s" rel="external noopener" data-cta-text="Get help with your installation"'|safe|format(referrals) %}
        {{ ftl('firefox-desktop-download-get-help', attrs=support_mac_attrs) }}
      </p>
      <p class="show-windows">
        {% set support_windows_attrs = 'href="https://support.mozilla.org/kb/how-download-and-install-firefox-windows%s" rel="external noopener" data-cta-text="Get help with your installation"'|safe|format(referrals) %}
        {{ ftl('firefox-desktop-download-get-help', attrs=support_windows_attrs) }}
      </p>
      <div class="show-linux">
        <div class="c-linux-button-group">
          <a href="{{ settings.BOUNCER_URL }}?product=firefox-latest-ssl&os=linux&lang={{ LANG }}" class="mzp-c-button mzp-t-product" data-testid="thanks-download-button-linux-32">{{ ftl('download-button-linux-32-v2') }}</a>
          <a href="{{ settings.BOUNCER_URL }}?product=firefox-latest-ssl&os=linux64&lang={{ LANG }}" class="mzp-c-button mzp-t-product" data-testid="thanks-download-button-linux-64">{{ ftl('download-button-linux-64-v2') }}</a>
        </div>
        {% set attrs = 'href="https://support.mozilla.org/kb/install-firefox-linux%s#w_install-firefox-deb-package-for-debian-based-distributions" rel="external noopener" data-cta-text="You can set up our APT repository instead"'|safe|format(referrals) %}
        <p class="linux-deb-text">{{ ftl('download-button-using-debian', attrs=attrs) }}</p>
      </div>
      <p class="show-else">
        {% set support_else_attrs = 'href="https://support.mozilla.org/products/firefox/install-and-update-firefox%s" rel="external noopener" data-cta-text="Get help with your installation"'|safe|format(referrals) %}
        {{ ftl('firefox-desktop-download-get-help', attrs=support_else_attrs) }}
      </p>

      {# Edge-case platform support messaging #}
      <p class="show-unknown">
        {{ ftl('firefox-desktop-download-your-system-may-not', url=firefox_url('desktop', 'all'))}}
      </p>
    </div>

    {{ download_firefox(force_direct=true, dom_id='thanks-download-button') }}

  </div>
  <div class="c-support-lang">
    <a href="{{ firefox_url('desktop', 'all') }}">{{ ftl('firefox-desktop-download-in-another-language') }}</a>
  </div>
</main>
{% endblock %}

{% block js %}
  {{ js_bundle('firefox_new_thanks') }}
{% endblock %}
